/**
 * 服务商OAuth配置类型定义
 */

// 微信公众号配置
export interface WechatMpConfig {
  appId: string
  appSecret: string
  token?: string
  encodingAesKey?: string
}

// 微信小程序配置
export interface WechatMiniappConfig {
  appId: string
  appSecret: string
  token?: string
  encodingAesKey?: string
}

// 微信开放平台配置
export interface WechatOpenConfig {
  appId: string
  appSecret: string
}

// 微信OAuth配置
export interface WechatOAuthConfig {
  mp: WechatMpConfig
  miniapp: WechatMiniappConfig
  open?: WechatOpenConfig
}

// 支付宝应用配置
export interface AlipayAppConfig {
  appId: string
  privateKey: string
  alipayPublicKey: string
}

// 支付宝OAuth配置
export interface AlipayOAuthSettings {
  scope: string[]
  redirectUri: string
}

// 支付宝OAuth配置
export interface AlipayOAuthConfig {
  app: AlipayAppConfig
  oauth: AlipayOAuthSettings
}

// 通用配置
export interface CommonOAuthConfig {
  environment: 'PRODUCTION' | 'SANDBOX'
  callbackDomain: string
  encryptionKey?: string
}

// 服务商OAuth配置
export interface ServiceProviderOAuthConfig {
  id: string
  providerId: string
  providerName: string
  wechatOAuth: WechatOAuthConfig
  alipayOAuth: AlipayOAuthConfig
  commonConfig: CommonOAuthConfig
  status: 'ACTIVE' | 'INACTIVE'
  createdTime: string
  updatedTime: string
}

// OAuth配置字段定义
export interface OAuthConfigField {
  fieldKey: string
  fieldName: string
  fieldType: 'input' | 'password' | 'textarea' | 'select' | 'switch'
  required: boolean
  placeholder?: string
  description?: string
  options?: { label: string; value: string | boolean }[]
  defaultValue?: any
}

// OAuth配置模板
export interface OAuthConfigTemplate {
  platformType: 'WECHAT' | 'ALIPAY'
  configType: 'MP' | 'MINIAPP' | 'OPEN' | 'APP' | 'OAUTH'
  fields: OAuthConfigField[]
}